package pers.wy.sell.utils;

import pers.wy.sell.vo.ResultVO;

/**
 * 返回状态
 *
 * @Author: 月落
 * @Date: Created in 21:05 2018/9/4
 */
public class ResultVOUtil {

    /**
     * SUCCESS
     *
     * @param object
     * @return
     */
    public static ResultVO success(Object object) {
        ResultVO resultVO = new ResultVO();
        resultVO.setData(object);
        resultVO.setCode(0);
        resultVO.setMsg("SUCCESS");
        return resultVO;
    }

    public static ResultVO success() {
        return success(null);
    }

    /**
     * ERROR
     *
     * @param code
     * @param msg
     * @return
     */
    public static ResultVO error(Integer code, String msg) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
    }

}
